#include  <cstdio>
#include  <math.h>
#include  <cstring>

int main(int argc, char *argv[])
{
	int a[1003],b[1003];
	int n,c;
	while( scanf("%d%d",&n,&c) != EOF )
	{
		int sum = 0;
		memset(a,0,1003*4);
		
		for( int i = 2 ; i < n ; ++i )
			if( a[i] == 0 )
				for( int j = 2; j*i <= n ; ++j )
					a[i*j] = 1;
	
		for( int i = 1, j = 1 ; i <= n ; ++i )
		{
			if( a[i] == 0 )
			{
				sum++;
				b[j++] = i;
			}
		}
	
		int center = sum/2;
		int l = center - (c-1);
		
		if(l < 0)
			l = 1;
		else if(sum %2 == 1)
			l += 1;

		printf("%d %d:",n,c);
		if( sum % 2 == 0 )
		{
			for( int j = l; j < l + 2*c && j <= sum ; ++j )
				printf(" %d",b[j]);
			
			printf("\n\n");
		}
		else
		{
			for( int j = l; j < l + 2*c - 1 && j <= sum ; ++j )
				printf(" %d",b[j]);
			
			printf("\n\n");
		}
	}
}
